<!DOCTYPE html>
<html lang="en-gb" dir="ltr">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Sticky - UIkit tests</title>
        <script src="../dist/js/uikit.js"></script>
        <script src="js/test.js"></script>
        <style type="text/css">

            #viewport { border: 1px dashed rgba(0,0,0,0.2); }

        </style>
    </head>

    <body>

        <div class="uk-container" style="height: 3500px;">

            <h1>Sticky</h1>

            <div id="viewport" class="uk-margin">
                <div class="uk-grid uk-child-width-1-6" uk-height-viewport="offset-top: true">
                    <div>

                        <div class="uk-card uk-card-primary uk-card-body" uk-sticky="offset: 50; bottom: #viewport">Stick to container; 50px offset</div>

                    </div>
                    <div>

                        <div class="uk-card uk-card-primary uk-card-body" uk-sticky="top: 100vh; target: 10">Sticky after 100vh; Scroll up if initially above paragraph below</div>

                    </div>
                    <div>

                        <div class="uk-card uk-card-primary uk-card-body" uk-sticky="top: #viewport; animation: uk-animation-slide-top">Stick below container; animation</div>

                    </div>
                    <div>

                        <div class="uk-card uk-card-primary uk-card-body" uk-sticky="bottom: #hash">Stick until next paragraph</div>

                    </div>
                    <div>

                        <div class="uk-card uk-card-primary uk-card-body" uk-sticky="show-on-up: true; animation: uk-animation-slide-top">Sticky on scroll up; animation</div>

                    </div>
                    <div>

                        <div class="uk-card uk-card-primary uk-card-body" uk-sticky="top: 300; animation: uk-animation-slide-top; media: 640">Sticky after 300px scrolling; @media 640px</div>

                    </div>
                </div>
            </div>

            <p id="hash" class="uk-margin-large">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

            <h2>Javascript Options</h2>

            <div class="uk-overflow-auto">
                <table class="uk-table uk-table-striped">
                    <thead>
                        <tr>
                            <th>Option</th>
                            <th>Value</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td><code>top</code></td>
                            <td>Number|% View Port Height|CSS Selector</td>
                            <td>0</td>
                            <td>The top offset from where the element should be stick.</td>
                        </tr>
                        <tr>
                            <td><code>bottom</code></td>
                            <td>Boolean|CSS Selector</td>
                            <td>false</td>
                            <td>The bottom offset until the element should stick. (true: parent element, prefixed with '!' a parent selector)</td>
                        </tr>
                        <tr>
                            <td><code>offset</code></td>
                            <td>Number</td>
                            <td>0</td>
                            <td>The offset the Sticky should be fixed to.</td>
                        </tr>
                        <tr>
                            <td><code>animation</code></td>
                            <td>String</td>
                            <td>false</td>
                            <td>The animation to use.</td>
                        </tr>
                        <tr>
                            <td><code>cls-active</code></td>
                            <td>String</td>
                            <td>uk-active</td>
                            <td>The active class.</td>
                        </tr>
                        <tr>
                            <td><code>cls-inactive</code></td>
                            <td>String</td>
                            <td>''</td>
                            <td>The inactive class.</td>
                        </tr>
                        <tr>
                            <td><code>sel-target</code></td>
                            <td>CSS Selector</td>
                            <td>self</td>
                            <td>The target element to apply active and inactive classes to. Defaults to the element itself.</td>
                        </tr>
                        <tr>
                            <td><code>width-element</code></td>
                            <td>CSS Selector</td>
                            <td>false</td>
                            <td>The element the Sticky should get its with from in active mode.</td>
                        </tr>
                        <tr>
                            <td><code>show-on-up</code></td>
                            <td>Boolean</td>
                            <td>false</td>
                            <td>Only show sticky element when scrolling up.</td>
                        </tr>
                        <tr>
                            <td><code>media</code></td>
                            <td>Integer|String</td>
                            <td>false</td>
                            <td>Condition for the active status - a width as integer (e.g. 640) or a breakpoint (e.g. @s, @m, @l, @xl).</td>
                        </tr>
                        <tr>
                            <td><code>target</code></td>
                            <td>Boolean</td>
                            <td>false</td>
                            <td>Initially make sure that the Sticky is not over a targeted element via location hash.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

        </div>

    </body>
</html>
